import { MerchantInfo } from "./merchant";

/**
 * 商品卡片
 * 用于主页推荐、搜索结果
 */
interface SkuCard {
    id: number;
    spuId: number;
    title: string;
    price: string;
    imageUrl: string;
}


interface SkuSpecValue {
    id: number;
    name: string;
}

interface SkuSpec {
    id: number;
    name: string;
    values: SkuSpecValue[];
}

interface SpuDetail {
    id: number;
    title: string;
    description: string;
    merchant: MerchantInfo;
}


interface SkuDetail {
    id: number;
    spuId: number;
    price: string;
    stock: number;
    imageUrl: string;
    specValueIds: number[];
}

interface ProductDetail {
    spu: SpuDetail,   
    specs: SkuSpec[],
    skus: SkuDetail[]
  }
  

export type { SkuCard, SkuDetail, SkuSpec, SkuSpecValue, ProductDetail };
